package com.example.springdemo7.Controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/getYml")
public class YmlController {
    @Value("${byte.key1}")
    private String key1;
    @Value("${byte.key2}")
    private String key2;

    @Value(("${spring.datasource.url}"))
    private String url;

    @RequestMapping("/getKey")
    public String getKey() {
        return "获取到配置信息中的Key：" + key1 + "," + key2;
    }

    @RequestMapping("/getUrl")
    public String getUrl() {
        return "获取到的url：" + url;
    }

}
